using UnityEngine;
using System.Collections;



public class BM_SceneManager : MonoBehaviour
{
	#region Members
	
	public GameObject		GameManagerPrefab = null;
	
	#endregion
	
	
	#region Properties

	#endregion
	
	
	
	public void Awake()
	{
		string strSceneManagerName = BM_Common.GetLabelName(StringLabel.LABEL_TAG_GAMEMANAGER);
		GameObject[] vGameObjects = GameObject.FindGameObjectsWithTag(strSceneManagerName);
		if(vGameObjects.Length > 1)
		{
			Debug.LogError(GetType()+".Awake() -> E' presente più di un gameobject con tag " + strSceneManagerName);
			Debug.DebugBreak();
		}
		else if(vGameObjects.Length == 0)
		{
			GameObject rSceneManager = (GameObject)GameObject.Instantiate(GameManagerPrefab);
			rSceneManager.name = strSceneManagerName;
			
			Debug.Log(GetType()+".Awake() -> Aggiungo il gameobject " + strSceneManagerName);
		}

		Screen.showCursor = false;
	}
}
